import {devMethods, DevMethods} from "@/utils/methods";

interface Config {
    elTableProps: { [key: string]: any };// ElFormTable组件的默认配置
    elSelectProps: { [key: string]: any };// ElSelect组件的默认配置
    elDatePickerProps: { [key: string]: any };// ElDateTime组件的默认配置
    devSearchTablePaginationProps: { [key: string]: any };// DevSearchTable组件的页码默认配置
    elFormProps: { [key: string]: any };// ElForm组件的默认配置
    elCascaderProps: { [key: string]: any };// ElCascader组件的默认配置
    elTooltipProps: { [key: string]: any };// ElTooltip组件的默认配置
    elInputProps: { [key: string]: any };
}

export type DefaultConfig = Config & DevMethods

const defaultConfig: DefaultConfig = {
    elTableProps: {
        rowKey:'id',
        border: true,
        style: { width: '100%' },
        headerCellStyle: {background: '#eff3f6', textAlign: 'center'},
    },
    // 下拉选择框
    elSelectProps: {
        style: {width: '100%'},
        clearable: true,
        placeholder: '请选择',
        tagType:'primary'
    },
    elDatePickerProps: {
        style: {width: '100%'},
        type:'datetimerange',
        clearable: true,
        placeholder: '请选择',
        rangeSeparator: '至',
        startPlaceholder: '开始时间',
        endPlaceholder: '结束时间',
        valueFormat:'YYYY-MM-DD HH:mm:ss'
    },
    devSearchTablePaginationProps: {
        layout: 'total, sizes, prev, pager, next',
        pageSizes: [10, 20, 50, 100],
        background: true
    },
    elFormProps: {

    },
    elCascaderProps: {
        tagType: 'primary',
        clearable: true,
        style: {width: '100%'},
        props: {
            emitPath: true,
            multiple:false,
            value: 'value',
            label: 'label',
            children: 'children',
            disabled: 'disabled'
        }
    },
    elTooltipProps: {
        effect:"dark",
    },
    elInputProps: {
        clearable: true, // 是否可清空
        style: {width: '100%'},
        placeholder: '请输入',
    },
    // 默认方法
    ...devMethods
};

export default defaultConfig;
